package tests;


import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import business.CalendarDate;

import business.Aluno;
import business.Disciplina;
import business.Inscricao;

public class InscricaoTest {

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}
	
	@Test
	public void validConstruct(){
		Inscricao a = new Inscricao(new Aluno(), new Disciplina(), new CalendarDate(), new CalendarDate(), 10);
	}
	
	@Test (expected=AssertionError.class)
	public void invalidConstruct(){
		Inscricao a = new Inscricao(null, null, null, null, -1);
	}
	
	@Test
	public void validSetAluno(){
		Inscricao a = new Inscricao();
		a.setAluno(new Aluno());
	}
	
	@Test (expected=AssertionError.class)
	public void invalidSetAluno(){
		Inscricao a = new Inscricao();
		a.setAluno(null);
	}
	
	@Test
	public void validSetDisciplina(){
		Inscricao a = new Inscricao();
		a.setDisciplina(new Disciplina());
	}
	
	@Test (expected=AssertionError.class)
	public void invalidSetDisciplina(){
		Inscricao a = new Inscricao();
		a.setDisciplina(null);
	}
	
	@Test
	public void validSetInscricao(){
		Inscricao a = new Inscricao();
		a.setDataInscricao(new CalendarDate());
	}
	
	@Test (expected=AssertionError.class)
	public void invalidSetInscricao(){
		Inscricao a = new Inscricao();
		a.setDataInscricao(null);
	}
	
	@Test
	public void validSetDResultado(){
		Inscricao a = new Inscricao();
		a.setDataResultado(new CalendarDate());
	}
	
	@Test (expected=AssertionError.class)
	public void invalidSetDResultado(){
		Inscricao a = new Inscricao();
		a.setDataResultado(null);
	}

	@Test
	public void validSetResultado(){
		Inscricao a = new Inscricao();
		a.setResultado(10);
	}
	
	@Test (expected=AssertionError.class)
	public void invalidSetResultadoTooHigh(){
		Inscricao a = new Inscricao();
		a.setResultado(45);
	}
	
	@Test (expected=AssertionError.class)
	public void invalidSetResultadoTooLow(){
		Inscricao a = new Inscricao();
		a.setResultado(-1);
	}
	
	@Test
	public void objectTester(){
		Inscricao.objectos();
	}
	
	@Test
	public void resetTester(){
		Inscricao.reset();
	}
	
	@Test
	public void getterTester(){
		Inscricao i = new Inscricao();
		i.getAluno();
		i.getClass();
		i.getDataInscricao();
		i.getDataResultado();
		i.getDisciplina();
		i.getResultado();
	}
	
	@Test
	public void toStringTester(){
		Inscricao i = new Inscricao();
		i.setAluno(new Aluno());
		i.setDataInscricao(new CalendarDate());
		i.setDataResultado(new CalendarDate());
		i.setDisciplina(new Disciplina());
		i.setResultado(0);
		i.toString();
	}
}
